<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Class: ActiveBackground::MiddleMan</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

    <script language="JavaScript" type="text/javascript">
    // <![CDATA[

        function toggleSource( id )
        {
          var elem
          var link

          if( document.getElementById )
          {
            elem = document.getElementById( id )
            link = document.getElementById( "l_" + id )
          }
          else if ( document.all )
          {
            elem = eval( "document.all." + id )
            link = eval( "document.all.l_" + id )
          }
          else
            return false;

          if( elem.style.display == "block" )
          {
            elem.style.display = "none"
            link.innerHTML = "show source"
          }
          else
          {
            elem.style.display = "block"
            link.innerHTML = "hide source"
          }
        }

        function openCode( url )
        {
          window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
        }
      // ]]>
    </script>

  </head>

  <body>
  <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
  <td class="file-title"><span class="file-title-prefix">Class</span><br />ActiveBackground::MiddleMan</td>
  <td align="right">
    <table cellspacing=0 cellpadding=2>
      <tr valign="top">
        <td>In:</td>
        <td>

<a href="../../files/vendor/plugins/active_background/tasks/__/lib/active_background/middle_man_rb.html">vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb</a>
        </td>
      </tr>
    <tr>
      <td>Parent:</td>
      <td>
        <a href="Client.html">
Client
         </a>

     </td>
   </tr>
         </table>
        </td>
        </tr>
      </table>
 <!-- banner header -->

  <div id="bodyContent">
      <div id="content">




  <div class="sectiontitle">Methods</div>
  <ul>
  <li><a href="#M000155">[]</a></li>
  <li><a href="#M000162">[]</a></li>
  <li><a href="#M000159">[]</a></li>
  <li><a href="#M000161">add</a></li>
  <li><a href="#M000160">add_job</a></li>
  <li><a href="#M000165">delete</a></li>
  <li><a href="#M000167">delete!</a></li>
  <li><a href="#M000156">each_job</a></li>
  <li><a href="#M000150">find</a></li>
  <li><a href="#M000157">get_job</a></li>
  <li><a href="#M000153">get_jobs</a></li>
  <li><a href="#M000158">job</a></li>
  <li><a href="#M000145">job_count</a></li>
  <li><a href="#M000146">job_progress</a></li>
  <li><a href="#M000154">jobs</a></li>
  <li><a href="#M000166">kill</a></li>
  <li><a href="#M000149">mark_as_terminated</a></li>
  <li><a href="#M000143">method_missing</a></li>
  <li><a href="#M000141">new</a></li>
  <li><a href="#M000144">new_job</a></li>
  <li><a href="#M000142">register</a></li>
  <li><a href="#M000164">remove</a></li>
  <li><a href="#M000163">remove_job</a></li>
  <li><a href="#M000151">server_terminate</a></li>
  <li><a href="#M000152">server_wait</a></li>
  <li><a href="#M000148">terminate</a></li>
  <li><a href="#M000147">terminate_job</a></li>
  </ul>


<div class="sectiontitle">Included Modules</div>
<ul>
  <li>Enumerable</li>
</ul>






<div class="sectiontitle">Public Class methods</div>
<div class="method">
  <div class="title">
    <a name="M000141"></a><b>new</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000141_source')" id="l_M000141_source">show source</a> ]</p>

  <div id="M000141_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 22</span>
22:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
23:       <span class="ruby-ivar">@handler</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
24:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>

<div class="sectiontitle">Public Instance methods</div>
<div class="method">
  <div class="title">
    <a name="M000155"></a><b>[]</b>()
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000153">get_jobs</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000162"></a><b>[]</b>(key, job)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000160">add_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000159"></a><b>[]</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000157">get_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000161"></a><b>add</b>(key, job)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000160">add_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000160"></a><b>add_job</b>(key, job)
  </div>
  <div class="description">

  <p>
add job with a uniq key
</p>
  </div>
<div class="aka">
  This method is also aliased as
  <a href="MiddleMan.html#M000161">add</a>
  <a href="MiddleMan.html#M000162">[]</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000160_source')" id="l_M000160_source">show source</a> ]</p>

  <div id="M000160_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 130</span>
130:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_job</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span>)
131:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">add_job</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span>)
132:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000165"></a><b>delete</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000163">remove_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000167"></a><b>delete!</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000163">remove_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000156"></a><b>each_job</b>() {|key, job| ...}
  </div>
  <div class="description">

  <p>
FIXME: need to get this to work
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000156_source')" id="l_M000156_source">show source</a> ]</p>

  <div id="M000156_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 114</span>
114:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_job</span>
115:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">get_jobs</span>().<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">jobs</span><span class="ruby-operator">|</span>
116:         <span class="ruby-identifier">jobs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span><span class="ruby-operator">|</span>
117:           <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span>
118:         <span class="ruby-keyword kw">end</span>
119:       <span class="ruby-keyword kw">end</span>
120:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000150"></a><b>find</b>(argument, options={}, *args) {|jobs| ...}
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000150_source')" id="l_M000150_source">show source</a> ]</p>

  <div id="M000150_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 77</span>
77:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">options</span>={}, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
78:       <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">argument</span>
79:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:all</span>
80:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
81:             <span class="ruby-identifier">get_jobs</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">jobs</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">jobs</span>}
82:           <span class="ruby-keyword kw">else</span>
83:             <span class="ruby-identifier">get_jobs</span>
84:           <span class="ruby-keyword kw">end</span>
85:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:first</span>
86:           <span class="ruby-identifier">get_jobs</span>().<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">job</span>}
87:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:last</span>
88:           <span class="ruby-identifier">get_jobs</span>().<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span><span class="ruby-operator">|</span> <span class="ruby-identifier">last</span>=<span class="ruby-identifier">job</span>}; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">last</span>;
89:         <span class="ruby-keyword kw">else</span>
90:           <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">argument</span>)
91:       <span class="ruby-keyword kw">end</span>
92:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000157"></a><b>get_job</b>(key)
  </div>
  <div class="description">

  <p>
get a job maching the passed key
</p>
  </div>
<div class="aka">
  This method is also aliased as
  <a href="MiddleMan.html#M000158">job</a>
  <a href="MiddleMan.html#M000159">[]</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000157_source')" id="l_M000157_source">show source</a> ]</p>

  <div id="M000157_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 123</span>
123:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_job</span>(<span class="ruby-identifier">key</span>)
124:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">get_job</span>(<span class="ruby-identifier">key</span>)
125:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000153"></a><b>get_jobs</b>() {|jobs| ...}
  </div>
  <div class="description">

  <p>
returns all -active- jobs as a hash (containing sub hashes)
</p>
  </div>
<div class="aka">
  This method is also aliased as
  <a href="MiddleMan.html#M000154">jobs</a>
  <a href="MiddleMan.html#M000155">[]</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000153_source')" id="l_M000153_source">show source</a> ]</p>

  <div id="M000153_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 103</span>
103:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_jobs</span>()
104:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
105:         <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">get_jobs</span>() {<span class="ruby-operator">|</span><span class="ruby-identifier">jobs</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">jobs</span>}
106:       <span class="ruby-keyword kw">else</span>
107:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">get_jobs</span>()
108:       <span class="ruby-keyword kw">end</span>
109:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000158"></a><b>job</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000157">get_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000145"></a><b>job_count</b>(options=[])
  </div>
  <div class="description">

  <p>
Arguments:
</p>
<pre>
  &lt;tt&gt;options&lt;/tt&gt;:
</pre>
<p>
Options:
</p>
<pre>
  &lt;tt&gt;:status&lt;/tt&gt;: status or array of statusses that need to be count
</pre>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000145_source')" id="l_M000145_source">show source</a> ]</p>

  <div id="M000145_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 51</span>
51:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">job_count</span>(<span class="ruby-identifier">options</span>=[])
52:       <span class="ruby-keyword kw">begin</span>
53:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span> <span class="ruby-operator">!=</span> []
54:           <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">job_count</span>
55:         <span class="ruby-keyword kw">else</span>
56:           <span class="ruby-identifier">count</span>=<span class="ruby-value">0</span>
57:           <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">each_job</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">job</span><span class="ruby-operator">|</span>
58:             <span class="ruby-identifier">count</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:status</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">job</span>.<span class="ruby-identifier">status</span>)
59:           <span class="ruby-keyword kw">end</span>
60:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">count</span>
61:         <span class="ruby-keyword kw">end</span>
62:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
63:         <span class="ruby-identifier">job_count</span>(<span class="ruby-identifier">options</span>)
64:       <span class="ruby-keyword kw">end</span>
65:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000146"></a><b>job_progress</b>(key)
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000146_source')" id="l_M000146_source">show source</a> ]</p>

  <div id="M000146_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 67</span>
67:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">job_progress</span>(<span class="ruby-identifier">key</span>)
68:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">send_command_to_job</span>(<span class="ruby-identifier">:progress</span>)
69:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000154"></a><b>jobs</b>()
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000153">get_jobs</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000166"></a><b>kill</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000163">remove_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000149"></a><b>mark_as_terminated</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000147">terminate_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000143"></a><b>method_missing</b>(method, *args)
  </div>
  <div class="description">

  <p>
TODO: Need to raise and error if handler doesn&#8217;t exist
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000143_source')" id="l_M000143_source">show source</a> ]</p>

  <div id="M000143_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 34</span>
34:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
35:       <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@handler</span>[<span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@handler</span>[<span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span>]
36:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000144"></a><b>new_job</b>(name, options={}, *args, &amp;job)
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000144_source')" id="l_M000144_source">show source</a> ]</p>

  <div id="M000144_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 38</span>
38:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_job</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>={}, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">job</span>)
39:       <span class="ruby-identifier">new_job</span> = <span class="ruby-constant">Job</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">args</span>)
40:       <span class="ruby-identifier">new_job</span>.<span class="ruby-identifier">define_job</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">job</span>)
41:       <span class="ruby-identifier">add_job</span>(<span class="ruby-identifier">new_job</span>.<span class="ruby-identifier">key</span>, <span class="ruby-identifier">new_job</span>)
42:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000142"></a><b>register</b>(handler)
  </div>
  <div class="description">

  <p>
TODO: Add some checking if the handler has all the expected methods
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000142_source')" id="l_M000142_source">show source</a> ]</p>

  <div id="M000142_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 27</span>
27:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">handler</span>)
28:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@handler</span>[(<span class="ruby-identifier">handler</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>)[<span class="ruby-value">1</span>]).<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>]
29:         <span class="ruby-ivar">@handler</span>[(<span class="ruby-identifier">handler</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>)[<span class="ruby-value">1</span>]).<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">handler</span>
30:       <span class="ruby-keyword kw">end</span>
31:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000164"></a><b>remove</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000163">remove_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000163"></a><b>remove_job</b>(key)
  </div>
  <div class="description">

  <p>
remove job matching the supplied key
</p>
  </div>
<div class="aka">
  This method is also aliased as
  <a href="MiddleMan.html#M000164">remove</a>
  <a href="MiddleMan.html#M000165">delete</a>
  <a href="MiddleMan.html#M000166">kill</a>
  <a href="MiddleMan.html#M000167">delete!</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000163_source')" id="l_M000163_source">show source</a> ]</p>

  <div id="M000163_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 137</span>
137:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_job</span>(<span class="ruby-identifier">key</span>)
138:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">remove_job</span>(<span class="ruby-identifier">key</span>)
139:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000151"></a><b>server_terminate</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000151_source')" id="l_M000151_source">show source</a> ]</p>

  <div id="M000151_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 94</span>
94:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_terminate</span>
95:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">terminate</span>
96:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000152"></a><b>server_wait</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000152_source')" id="l_M000152_source">show source</a> ]</p>

  <div id="M000152_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 98</span>
 98:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_wait</span>
 99:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">wait</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@server</span>
100:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000148"></a><b>terminate</b>(key)
  </div>
  <div class="description">

  <p>
Alias for <a href="MiddleMan.html#M000147">terminate_job</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000147"></a><b>terminate_job</b>(key)
  </div>
<div class="aka">
  This method is also aliased as
  <a href="MiddleMan.html#M000148">terminate</a>
  <a href="MiddleMan.html#M000149">mark_as_terminated</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000147_source')" id="l_M000147_source">show source</a> ]</p>

  <div id="M000147_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/middle_man.rb, line 71</span>
71:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">terminate_job</span>(<span class="ruby-identifier">key</span>)
72:       <span class="ruby-ivar">@@server</span>.<span class="ruby-identifier">send_command_to_job</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">:terminate</span>)
73:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
</div>

  </div>

    </body>
</html>